package com.eastseeway.radioproject.entities;

import android.util.Log;

import androidx.annotation.Keep;

import com.eastseeway.radioproject.utils.ByteUtil;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import struct.StructClass;
import struct.StructField;
@Keep
@StructClass
public class BeanToNegativePressureBoard {

    @StructField(order = 0)
    int handleGasPress;      //offset:0,  手柄端请求的压力值 -45 -50 -55 -60

    @StructField(order = 1)
    int gasPipeAndHandleDiff;//offset:4,  气体管路与手柄的压力差值

    @StructField(order = 2)
    int gasContainerPressMax;//offset:8,  气罐压力上限值

    @StructField(order = 3)
    int gasContainerPressMin; //offset:12, 气罐压力下限值;

    public int getHandleGasPress() {
        return handleGasPress;
    }

    public void setHandleGasPress(int handleGasPress) {
        this.handleGasPress = handleGasPress;
    }

    public int getGasPipeAndHandleDiff() {
        return gasPipeAndHandleDiff;
    }

    public void setGasPipeAndHandleDiff(int gasPipeAndHandleDiff) {
        this.gasPipeAndHandleDiff = gasPipeAndHandleDiff;
    }

    public int getGasContainerPressMax() {
        return gasContainerPressMax;
    }

    public void setGasContainerPressMax(int gasContainerPressMax) {
        this.gasContainerPressMax = gasContainerPressMax;
    }

    public int getGasContainerPressMin() {
        return gasContainerPressMin;
    }

    public void setGasContainerPressMin(int gasContainerPressMin) {
        this.gasContainerPressMin = gasContainerPressMin;
    }

//    byte[] command;
//
//    public BeanToNegativePressureBoard(byte[] command) {
//        this.command = command;
//    }
//
//    public byte[] getCommand() {
//        return command;
//    }
//
//
//    public static final class StartBuilder{
//
//        int address;
//
//        int handleGasPress;      //offset:0,  手柄端请求的压力值 -45 -50 -55 -60
//        int gasPipeAndHandleDiff;//offset:4,  气体管路与手柄的压力差值
//        int gasContainerPressMax;//offset:8,  气罐压力上限值
//        int gasContainerPressMin; //offset:12, 气罐压力下限值;
//
//        public StartBuilder setAddress(int address) {
//            this.address = address;
//            return this;
//        }
//
//        public StartBuilder setHandleGasPress(int handleGasPress) {
//            this.handleGasPress = handleGasPress;
//            return this;
//        }
//
//        public StartBuilder setGasPipeAndHandleDiff(int gasPipeAndHandleDiff) {
//            this.gasPipeAndHandleDiff = gasPipeAndHandleDiff;
//            return this;
//        }
//
//        public StartBuilder setGasContainerPressMax(int gasContainerPressMax) {
//            this.gasContainerPressMax = gasContainerPressMax;
//            return this;
//        }
//
//        public StartBuilder setGasContainerPressMin(int gasContainerPressMin) {
//            this.gasContainerPressMin = gasContainerPressMin;
//            return this;
//        }
//
//        public BeanToNegativePressureBoard build(){
//            ByteBuffer byteBuffer = ByteBuffer.allocate(80).order(ByteOrder.LITTLE_ENDIAN);
//            byteBuffer.putInt(address);
//            byteBuffer.position(10);
//            byteBuffer.put((byte) 0x40);
//
//            ByteBuffer content = ByteBuffer.allocate(64).order(ByteOrder.LITTLE_ENDIAN);
//            content.putInt(handleGasPress);
//            content.flip();
//
//            byteBuffer.put(content);
//            byteBuffer.position(75);
//            byteBuffer.put((byte)0x01);
//            byteBuffer.put((byte)0x01);
//            return new BeanToNegativePressureBoard(byteBuffer.array());
//        }
//    }
}
